<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en"
      xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateContactTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:form>
                <h:panelGrid columns="3">
                    <h:outputLabel value="#{bundle.CreateContactLabel_firstName}" for="firstName" />
                    <h:inputText id="firstName" value="#{contactController.selected.firstName}" title="#{bundle.CreateContactTitle_firstName}" />
                    <h:message for="firstName" />
                    <h:outputLabel value="#{bundle.CreateContactLabel_lastName}" for="lastName" />
                    <h:inputText id="lastName" value="#{contactController.selected.lastName}" title="#{bundle.CreateContactTitle_lastName}" />
                    <h:message for="lastName" />
                    <h:outputLabel value="#{bundle.CreateContactLabel_birthday}" for="birthday" />
                    <h:inputText id="birthday" value="#{contactController.selected.birthday}" title="#{bundle.CreateContactTitle_birthday}" >
                        <f:convertDateTime pattern="MM/dd/yyyy" />
                    </h:inputText>
                    <h:message for="birthday" />
                    <h:outputLabel value="#{bundle.CreateContactLabel_homePhone}" for="homePhone" />
                    <h:inputText id="homePhone" value="#{contactController.selected.homePhone}" title="#{bundle.CreateContactTitle_homePhone}" />
                    <h:message for="homePhone" />
                    <h:outputLabel value="#{bundle.CreateContactLabel_mobilePhone}" for="mobilePhone" />
                    <h:inputText id="mobilePhone" value="#{contactController.selected.mobilePhone}" title="#{bundle.CreateContactTitle_mobilePhone}" />
                    <h:message for="mobilePhone" />
                    <h:outputLabel value="#{bundle.CreateContactLabel_email}" for="email" />
                    <h:inputText id="email" value="#{contactController.selected.email}" title="#{bundle.CreateContactTitle_email}" />
                    <h:message for="email" />
                </h:panelGrid>
                <br />
                <h:commandLink action="#{contactController.create}" value="#{bundle.CreateContactSaveLink}" />
                <br />
                <br />
                <h:commandLink action="#{contactController.prepareList}" value="#{bundle.CreateContactShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.CreateContactIndexLink}" action="/index" immediate="true" />
            </h:form>
        <div class="messagecolor">
            <h:messages showSummary="true" 
                        showDetail="false"
                        errorStyle="color: #d20005" 
                        infoStyle="color: green"/>
        </div>
        </ui:define>
    </ui:composition>

</html>
